package cn.bjsxt.test;

import java.io.File;

public class FileTree {
	public static void main(String[] args){
		File f = new File("d:/Echo-Files/Echo-code/TestDate");
		printFile(f, 0);
	}
	
	static void printFile(File file, int level) {
		for (int i = 0; i < level; i++){
			System.out.print("_");
		}
		System.out.println(file.getName());
		
		if (file.isDirectory()) {
			File[] files = file.listFiles();
			for(int j = 0; j < files.length; j++){
				printFile(files[j], level + 1);
			}
		}
	}
}
